window.onload = function () {
    // 获取user_id参数的值
    const urlParams = new URLSearchParams(window.location.search);
    const userId = urlParams.get('user_id') || localStorage.getItem('user_id') || 1;
    const userName = urlParams.get('user_name') || localStorage.getItem('user_name') || 'doctor';
    // 将user_id存储到localStorage中
    localStorage.setItem('user_id', userId);
    localStorage.setItem('user_name', userName);
    // 打印用户ID

    var url = "static/model/imcs21-cblue-main/task3/t5/test/predict_result.json"/*json文件url，本地的就写本地的位置，如果是服务器的就写服务器的路径*/
    var request = new XMLHttpRequest();
    request.open("get", url);/*设置请求方法与路径*/
    request.send(null);/*不发送数据到服务器*/
    request.onload = function () {/*XHR对象获取到返回信息后执行*/
        if (request.status == 200) {/*返回状态为200，即为数据获取成功*/
            var json = JSON.parse(request.responseText);

            //console.log(request.responseText);
            for(var i in json)
            {
                //console.log(json[i]);
                var cnt=0;
                for(var j in json[i])
                {
                    cnt++;
                    var name = "shuchu"+cnt;
                    //console.log(j);
                    //console.log(json[i][j]);

                    document.getElementById(name).innerHTML = json[i][j];
                }
            }
            //console.log(json);
        }
    }
}

const back = document.getElementById("back-bt");

back.onclick = () => {
      window.history.back();
}